package com.techshine.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.techshine.entity.User;
import org.springframework.stereotype.Service;

import com.techshine.entity.Constant;
import com.techshine.mapper.ConstantMapper;
import com.techshine.service.ConstantService;

 
/** 
 * 说明： 常量
 * 
 */
@Service
public class ConstantServiceImpl implements ConstantService {
	
	@Resource
	private ConstantMapper constantMapper;
	@Override
	public Constant queryByKey(String id)throws Exception{
		return constantMapper.queryByKey(id);
	}
	@Override
	public List<Constant> queryListByPage(Constant entity)throws Exception{
		return constantMapper.queryListByPage(entity);
	}
	@Override
	public List<Constant> queryList(Constant entity)throws Exception{
		return constantMapper.queryList(entity);
	}
	@Override
	public void insert(Constant entity)throws Exception{
		constantMapper.insert(entity);
	}
	@Override
	public void insertSelective(Constant entity)throws Exception{
		 constantMapper.insertSelective(entity);
	}
	@Override
	public void update(Constant entity)throws Exception{
	 	constantMapper.update(entity);
	}
	@Override
	public void updateByKeySelective(Constant entity)throws Exception{
		 constantMapper.updateByKeySelective(entity);
	}
	public void delete(Constant entity)throws Exception{
		 constantMapper.delete(entity);
	}
	@Override
	public void delmore(String ids) throws Exception {
		// TODO Auto-generated method stub
		String[] split = ids.split(",");
		Constant node=new Constant();
		for(String id:split) {
			node.setId(Integer.parseInt(id));
			constantMapper.delete(node);
		}
	}

	@Override
	public User queryByKeyqqq(User user) throws Exception {
		User user1=constantMapper.queryname(user);
		return user1;
	}


}

